//
//  ViewController.swift
//  自定义相机
//
//  Created by slience on 2019/8/9.
//  Copyright © 2019 shehuiren. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    @IBOutlet weak var imageV : UIImageView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
    }
    
    @IBAction  func click(_ sender :Any){
    
        AuthorityTools.cameraAuthority(complete: { (allow) in
            
            if allow == true{
                
                
                let vc = storyboard?.instantiateViewController(withIdentifier: "camera") as! CameraVC
                
                vc.complete = {[weak self](img)in
                    
                    if let pic = img{
                        
                        self?.imageV.image = pic
                    }
                }
                
                self.present(vc, animated: true, completion: nil)
                
                
            }
        })
    }


}

